package com20230214;

public class StudentScore {
    public static void main(String[] args) {
        int[][] score = new int[][]{
                {67,75},
                {78,82,93},
                {71,72}
        };
//        int total = 0;
//        for (int i = 0; i < score.length; i++) {
//            for (int j = 0; j < score[i].length; j++) {
//                total += score[i][j];
//            }
//            System.out.println( i+1 + "班的总成绩是：" + total );
//            total在第一层for循环外，计算的是三个班学生的总成绩


        int total;
        for (int i = 0; i < score.length; i++) {
            total = 0;
            for (int j = 0; j < score[i].length; j++) {
                total += score[i][j];
            }
            System.out.println( i+1 + "班的总成绩是：" + total );

        }
    }
}
